<div class="am-g">
    <!-- Row start -->
    <div class="am-u-sm-12">
        <div class="card-box">
            <form action="" class="am-form" method="post" data-am-validator id="doc-vld-msg">
                <fieldset>
                    <legend>添加用户</legend>
                    <div class="am-form-group">
                        <input type="hidden" name="Id" class="am-form-field" value="{{.Sdata.Id}}" />
                        <label for="doc-vld-name-2">公司名称:</label>
                        <input type="text" id="doc-vld-name-2" name="Name" value="{{.Sdata.Name}}" class="am-form-field"/>
                    </div>
                    <div class="am-form-group">
                        <label for="doc-vld-name-2">联系人:</label>
                        <input type="text" id="doc-vld-name-2" value="{{.Sdata.Pname}}" class="am-form-field"  name="Pname"/>
                    </div>

                    <div class="am-form-group">
                        <label for="doc-vld-email-2">邮箱：</label>
                        <input type="email" id="doc-vld-email-2" value="{{.Sdata.Email}}" name="Email" placeholder="输入邮箱"/>
                    </div>

                    <div class="am-form-group">
                        <label for="doc-vld-mobile-2">手机号码：</label>
                        <input type="text" class="js-pattern-mobile" value="{{.Sdata.Phone}}" name="Phone" id="doc-vld-mobile-2" placeholder="手机号码"/>
                    </div>
                    <div class="am-form-group">
                        <label for="doc-vld-mobile-2">座机:</label>
                        <input type="text" class="js-pattern-mobile" value="{{.Sdata.Telp}}" name="Telp" id="doc-vld-mobile-2" placeholder="昵称" />
                    </div>
                     <div class="am-form-group">
                        <label for="doc-vld-mobile-2">微信:</label>
                        <input type="text" class="js-pattern-mobile" value="{{.Sdata.Watch}}" name="Watch" id="doc-vld-mobile-2" placeholder="微信"/>
                    </div>
                    <div class="am-form-group">
                        <label>单位类型： </label>
                        <label class="am-radio-inline">
								        <input type="radio" {{if eq .Sdata.Ifc 0}} checked="checked" {{end}}  value="0" name="Ifc" required> 公司
								      </label>
                        <label class="am-radio-inline">
								        <input type="radio"  {{if eq .Sdata.Ifc 1}} checked="checked" {{end}}   value="1" name="Ifc"> 个人
						</label>
                    </div>
                    <div class="am-form-group">
                        <label>状态： </label>
                        <label class="am-radio-inline">
								        <input type="radio"  {{if eq .Sdata.Valid 0}} checked="checked" {{end}}  value="0" name="Valid" required> 有效
								      </label>
                        <label class="am-radio-inline">
								        <input type="radio"   {{if eq .Sdata.Valid 1}} checked="checked" {{end}}  value="1" name="Valid"> 无效
								      </label>
                    </div>

                    <div class="am-form-group">
                        <label>类型： </label>
                        <label class="am-radio-inline">
								        <input type="radio"  {{if eq .Sdata.Ctype 0}} checked="checked" {{end}}  value="0" name="Ctype" required> 供应商
						</label>
                        <label class="am-radio-inline">
								        <input type="radio"  {{if eq .Sdata.Ctype 1}} checked="checked" {{end}}   value="1" name="Ctype"> 客户
						</label>
                    </div>

                    <div class="am-form-group">
                        <label>客户忠诚度： </label>
                        <label class="am-radio-inline">
							<input type="radio"  value="0" {{if eq .Sdata.Ifz 0}} checked="checked" {{end}}  name="Ifz" required>一般
						</label>
                        <label class="am-radio-inline">
							<input type="radio"   value="1"  {{if eq .Sdata.Ifz 1}} checked="checked" {{end}} name="Ifz"> 好
						</label>
                        <label class="am-radio-inline">
							<input type="radio"   value="2" {{if eq .Sdata.Ifz 2}} checked="checked" {{end}}  name="Ifz"> 很好
						</label>
                        <label class="am-radio-inline">
							<input type="radio"   value="3"  {{if eq .Sdata.Ifz 3}} checked="checked" {{end}} name="Ifz"> 非常好
						</label>
                    </div>
                    <div class="am-form-group">
                        <label>省</label>
                        <select id="doc-select-1" name="Province">
                            {{range .one}}
                            <option value="{{.Id}}" {{if eq $.Sdata.Province .Id}} selected="selected" {{end}} >{{.Fullname}}</option>
                            {{end}}
                        </select>
                        <span class="am-form-caret"></span>
                    </div>
                    <div class="am-form-group">
                        <label>市</label>
                        <select id="doc-select-2" name="City">
                             {{range .two}}
                            <option value="{{.Id}}" {{if eq $.Sdata.City .Id}} selected="selected" {{end}} >{{.Fullname}}</option>
                            {{end}}
                        </select>
                        <span class="am-form-caret"></span>
                    </div>
                    <div class="am-form-group">
                        <label>县/区</label>
                        <select id="doc-select-3" name="District">
                             {{range .three}}
                            <option value="{{.Id}}" {{if eq $.Sdata.District .Id}} selected="selected" {{end}} >{{.Fullname}}</option>
                            {{end}}
                        </select>
                        <span class="am-form-caret"></span>
                    </div>
                   <div class="am-form-group">
                        <label for="doc-vld-mobile-2">详细地址：</label>
                        <input type="text" class="js-pattern-mobile" value="{{.Sdata.Street}}" name="Street" id="doc-vld-mobile-2" placeholder="备注" />
                    </div>
                    <button class="am-btn am-btn-secondary" type="submit">提交</button>
                </fieldset>
            </form>


        </div>
    </div>
    <!-- Row end -->
</div>
</div>
</div>

<script>
        $("#doc-select-1").change(function(){
            var id=$(this).val();
            if(id<=0){
                return
            }
            $.get("/area/city",{pid:id},function(data){
                if(data.status==1){
                    var d=data.list
                    var _html=""
                    d.forEach(function(value) {
                        _html=_html+"<option value='"+value.id+"'>"+value.fullname+"</option>"
                    }, this);
                    $("#doc-select-2").html(_html)
                }
            },"json")
        })
         $("#doc-select-2").change(function(){
            var id=$(this).val();
            if(id<=0){
                return
            }
            $.get("/area/city",{pid:id},function(data){
                if(data.status==1){
                    var d=data.list
                    var _html=""
                    d.forEach(function(value) {
                        _html=_html+"<option value='"+value.id+"'>"+value.fullname+"</option>"
                    }, this);
                    $("#doc-select-3").html(_html)
                }
            },"json")
        })


</script>